﻿using Genius.Locator.Internal;
using Modules.VocabularyTrainer.Shared.Strategy;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Modules.VocabularyTrainer.Shared.BO;
using Genius.Brain.Shared;

namespace Modules.VocabularyTrainer.Shared.Locator
{
    public class VocabularyTrainerLocator
    {
        public static ITranslatorStrategy GetTranslatorStrategy(string[] fileNames)
        {
            return ContainerHolder.Resolve<ITranslatorStrategy>(new { dictionaries = fileNames });
        }

        public static ITranslatorStrategy GetTranslatorStrategy(string fileName)
        {
            return ContainerHolder.Resolve<ITranslatorStrategy>(new { dictionaries = new string[] { fileName } });
        }

        public static IVocabularyMatchRateStrategy VocabularyMatchRateStrategy(string fileName)
        {
            return ContainerHolder.Resolve<IVocabularyMatchRateStrategy>(new { configuration = fileName });
        }


        public static IDictionaryDatabaseRecord GetDictionaryDatabaseRecord()
        {
            return ContainerHolder.Resolve<IDictionaryDatabaseRecord>();
        }

        public static IJsonDatabase<IDictionaryDatabaseRecord> GetDictionaryDatabase()
        {
            return ContainerHolder.Resolve<IJsonDatabase<IDictionaryDatabaseRecord>>();
        }
    }
}
